
<?php 
		
	$pid = explode(',', $model->media_cid);
	$pid = $pid[0];
	$menu = array_reverse(Category::model()->generateBreadcrumbs($pid,'list'));
	
	$this->breadcrumbs = array_merge($this->breadcrumbs,$menu);
	$this->breadcrumbs = array_merge($this->breadcrumbs,array($model->media_name));
		
	$this->pageTitle = Category::model()->generatePageTitle(array_reverse($this->breadcrumbs,'_')).Yii::app()->name;
		
?>
<style type="text/css">
.pin {
	text-align:left;
	word-wrap:break-word;
	overflow:hidden;
	word-break:break-all;
}
.pin .title{
	padding:5px;
}
</style>

<hr class="clearfix" />
	<!-- 此处加一个空格，以使能正常显示加载内容 -->
	&nbsp;
	<div class="containerBox" >
	<img src="/public/images/loading.gif" />
	<?php //加载相关内容?>
	</div>
	<div id="loading">
	正在加载中……
	</div>
	<div id="noshow">
		亲，已经没有了！
	</div>


<script type="text/javascript">

/*****
*使用colorbox显示图片
*/
function imageShow(object){	    
    
	$("a[rel=colorbox]").colorbox({
		'maxWidth':'95%',
		'maxHeight':'95%',


	});	

	//绑定click事件，显示相应的图片信息
	$("#tabs>li:eq(1)").trigger('click');

	colorboxHover();
	
	return false;
}

/**
 *事件驱动$("a[rel=colorbox]")的hover事件
 */
function colorboxHover(){
	$("a[rel=colorbox]").hover(function(){
		$("#tab2>.posts").html($(this).attr("id"));
	});
}

	 

$(document).ready(function() {

		/****
		 *使用windsWaterFlow滚动鼠标 动态加载内容
		 */
		
		var url = '<?php echo Yii::app()->createUrl('/work/listpage',array('id'=>$_GET['id']));?>';
//	var boxtemplate = '<div class="pin hide">{img}<div class="title">{title}</div><div class="like btn">喜欢</div><div class="comments btn">评论</div></div>';

//		var boxtemplate = '<div class="pin hide"><a href="{origionimg}" id="{id}" rel="colorbox" onclick="imageShow($(this));return false;"><div class="img"><img src="{img}" style="" alt="" /></div></a><div class="title">{title}</div><div class="like btn">喜欢</div><div class="comments btn">评论</div></div>';
		var boxtemplate = '<div class="pin hide" id="{id}" >'
                            +'<a href="{origionimg}"rel="colorbox" onclick="imageShow($(this));return false;">'
                                +'<div class="img"><img src="{img}" style="" alt="" /></div>'
                            +'</a>'
                            +'<div class="title">'
                                +'名称：<a href="/work/view/{id}.html">{name}</a><br />时间：{created}<br />' 
                            +'</div>'
                            +'<div class="like btn" onclick="YKG.app(\'gallary\').folder(<?php echo $model->media_id; ?>,{id});">封面</div>'
                            +'<div class="comments btn">评论</div></div>';		
		windsWaterFlow(url,boxtemplate,210);
        
/**
 *         $(".containerBox").windswaterflow({
 *             itemSelector: '.pin',
 *             loadSelector: '#loading',
 *             noSelector: '#noshow',
 *             boxTemplate: boxtemplate, //'<div class="pin hide"><a href="#"><div class="img"><img src="{img}" style="height:{height}px;" alt="" /></div></a><div class="title">{title}</div><div class="like btn">喜欢</div><div class="comments btn">评论</div></div>',
 *             columnWidth: 210,
 *             marginWidth: 14,
 *             marginHeight: 16,
 *             ajaxServer: url,
 *             boxParam: 'num',
 *             pageParam: 'page',
 *             maxPage: 0,
 *             init: true,
 *             initBoxNumber: 10,
 *             scroll: true,
 *             scrollBoxNumber: 10,
 *             callback: function() {
 *                 $(".pin").mouseover(function() {
 *                     $(this).find(".btn").show();
 *                 }).mouseout(function() {
 *                     $(this).find('.btn').hide();
 *                 });
 *             }
 *         });
 */


		/************
		 *滚动固定内容
		 **************/

			$(document).scroll(function(){

				if($(this).scrollTop() > 150){
					$("#scroll-widget").css({
						'position':'relative',
                        'height':document.documentElement.clientHeight,
						'top':$(this).scrollTop()-170,
                        'overflow':'hidden'
					});
				}else{
					$("#scroll-widget").css({
						'position':'relative',
                        'height':document.documentElement.clientHeight,
						'top':0,
                        'overflow':'hidden'
					});
				}


				//绑定a[rel=colorbox]的hover事件
				colorboxHover();                
			
			});


		
	});
</script>
	<?php 
	 	//Create an instance of ColorBox
	 	$this->widget('application.extensions.box.colorbox.colorboxWidget');
	
	?>